package {
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	import org.osflash.signals.Signal;

	public class Button {
		
		protected var _view:MovieClip;
		
		public var click:Signal;
		
		public function Button(view:MovieClip) {
			_view = view;
			view.buttonMode = true;
			view.mouseChildren = false;
			click = new Signal();
			view.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
			view.addEventListener(MouseEvent.ROLL_OVER, onRollOver, false, 0, true);
			view.addEventListener(MouseEvent.ROLL_OUT, onRollOut, false, 0, true);
		}
		
		protected function onMouseDown(e:MouseEvent):void {
			click.dispatch();
		}
		
		protected function onRollOver(e:MouseEvent):void {
			
		}
		
		protected function onRollOut(e:MouseEvent):void {
			
		}
	}
}